package dbLayer;

import java.sql.SQLException;
import java.util.List;

import modelLayer.Schedule;

public interface DBScheduleIF {

	/**
	 * Inserts a new row into the database table Schedule.
	 * This method uses prepared statements to sanitize our 
	 * database input.
	 * 
	 * @param	clName			String	the name of the class the schedule
	 * 									is associated with.
	 * @param	numberOfBlocks	int		number of blocks to add.
	 * @return	rc				int		the count of rows changed in the database
	 * @throws 					SQLException 
	 */
	public int insert(String clName, int numberOfBlocks) throws SQLException;

	/**
	 * Finds a row in the database table Schedule.
	 * 
	 * @param	clName				String			the name of the class the schedule
	 * 												is associated with.
	 * @param	retrieveAssociation	boolean			determines if we're to retrieve 
	 * 												associations or not.
	 * @return						Schedule		returns the schedule matching the search.
	 */
	public Schedule find(String clName, boolean retriveAssociation);
	
	/**
	 * Finds a row in the database table Schedule.
	 * 
	 * @param	id					int				id of the schedule.
	 * @param	retrieveAssociation	boolean			determines if we're to retrieve 
	 * 												associations or not.
	 * @return						Schedule		returns the schedule matching the search.
	 */
	public Schedule findById(int scheduleId, boolean retriveAssociation);
	
	/**
	 * Finds all rows in the database table Schedule. 
	 * 
	 * @param	retrieveAssociation	boolean			determines if we're to retrieve 
	 * 												associations or not.
	 * @return						List<Schedule>  returns a list of Schedules.
	 */
	public List<Schedule> getAll(boolean retrieveAssociation);
	
	/**
	 * Updates a row in the database table Schedule. 
	 * 
	 * @param	tbId		int			teaching block id.
	 * @param	schId		int			schedule id
	 * @param	blockNumber	int			the block number in the schedule
	 * @param	clName		String		the name of the schedule the class is associated with.
	 * @return	rc			int			the count of rows changed in the database
	 */
	public int update(String clName, int tbId, int blockNumber, int schId);

	/**
	 * Removes a row in the database table Schedule. 
	 * 
	 * @param	clName		String	the name of the class the schedule is
	 * 								associated with.
	 * @return	rc			int		the count of rows changed in the database
	 */
	public int remove(String clName);
	
}